﻿<?xml version="1.0" encoding="utf-8"?>
<FieldTypes>

    <FieldType>
        <Field Name="TypeName">AdvancedLookupField</Field>
        <Field Name="TypeDisplayName">$Resources:AdvancedLookup,AdvancedLookupDisplayName;</Field>
        <Field Name="TypeShortDescription">$Resources:AdvancedLookup,AdvancedLookupDescription;</Field>
        <Field Name="ParentType">Lookup</Field>
        <Field Name="FieldTypeClass">AdvancedLookup.AdvancedLookupField,AdvancedLookup, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3443098eba475529</Field>
        <Field Name="UserCreatable">TRUE</Field>
        <Field Name="ShowInListCreate">TRUE</Field>
        <Field Name="ShowInSurveyCreate">TRUE</Field>
        <Field Name="ShowInDocumentLibraryCreate">TRUE</Field>
        <Field Name="InternalType">Lookup</Field>
        <Field Name="SQLType">int</Field>
        <Field Name="ParentType"></Field>
        <Field Name="Sortable">TRUE</Field>
        <Field Name="Filterable">TRUE</Field>
        <Field Name="FieldEditorUserControl">/_controltemplates/AdvancedLookupFieldEditor.ascx</Field>
        <RenderPattern Name="HeaderPattern">
            <Switch>
                <Expr>
                    <Property Select='Filterable'/>
                </Expr>
                <Case Value="FALSE"> </Case>
                <Default>
                    <Switch>
                        <Expr>
                            <GetVar Name='Filter'/>
                        </Expr>
                        <Case Value='1'>
                            <HTML><![CDATA[<SELECT ID="diidFilter]]></HTML>
                            <Property Select='Name'/>
                            <HTML>                  <![CDATA[" TITLE=]]></HTML>
                            <HTML>"$Resources:core,501;</HTML>
                            <Property Select='DisplayName' HTMLEncode='TRUE'/>
                            <HTML><![CDATA[" OnChange='FilterField("]]></HTML>
                            <GetVar Name="View"/>
                            <HTML><![CDATA[",]]></HTML>
                            <ScriptQuote>
                                <Property Select='Name' URLEncode="TRUE"/>
                            </ScriptQuote>
                            <HTML><![CDATA[,this.options[this.selectedIndex].value, this.selectedIndex);' dir="]]></HTML>
                            <Property Select="Direction" HTMLEncode="TRUE"/>
                            <HTML><![CDATA[">]]></HTML>
                            <FieldFilterOptions BooleanTrue="$Resources:core,fld_yes;" BooleanFalse="$Resources:core,fld_no;" NullString="$Resources:core,fld_empty;" AllItems="$Resources:core,fld_all;"></FieldFilterOptions>
                            <HTML><![CDATA[</SELECT><BR>]]></HTML>
                        </Case>
                    </Switch>
                </Default>
            </Switch>
            <Switch>
                <Expr>
                    <Property Select='Sortable'/>
                </Expr>
                <Case Value="FALSE">
                    <Property Select='DisplayName' HTMLEncode="TRUE"/>
                </Case>
                <Default>
                    <Switch>
                        <Expr>
                            <GetVar Name='SortDisable'/>
                        </Expr>
                        <Case Value='TRUE'>
                            <Property Select='DisplayName' HTMLEncode="TRUE"/>
                        </Case>
                        <Default>
                            <HTML><![CDATA[<A ID="diidSort]]></HTML>
                            <Property Select='Name'/>
                            <HTML>        <![CDATA[" onfocus="OnFocusFilter(this)" TITLE=]]></HTML>
                            <HTML>"$Resources:core,500;</HTML>
                            <Property Select='DisplayName' HTMLEncode='TRUE'/>
                            <HTML><![CDATA[" HREF="javascript:" OnClick="javascript:return OnClickFilter(this,event);" ]]></HTML>
                            <HTML><![CDATA[ SORTINGFIELDS="]]></HTML>
                            <FieldSortParams HTMLEncode="TRUE"/>
                            <HTML><![CDATA[">]]></HTML>
                            <Property Select='DisplayName' HTMLEncode="TRUE"/>
                            <HTML><![CDATA[<img src="/_layouts/images/blank.gif" class="ms-hidden" border=0 width=1 height=1 alt="]]></HTML>
                            <HTML>$Resources:OpenMenuKeyAccessible;</HTML>
                            <HTML><![CDATA[">]]></HTML>
                            <HTML><![CDATA[</A><IMG SRC="]]></HTML>
                            <FieldSortImageURL/>
                            <HTML><![CDATA[" ALT="]]></HTML>
                            <Switch>
                                <Expr>
                                    <GetVar Name='SortDir'/>
                                </Expr>
                                <Case Value='Asc'>
                                    <HTML>$Resources:core,150;</HTML>
                                </Case>
                                <Case Value='Desc'>
                                    <HTML>$Resources:core,151;</HTML>
                                </Case>
                                <Default>
                                    <HTML></HTML>
                                </Default>
                            </Switch>
                            <HTML><![CDATA[" BORDER=0>]]></HTML>
                        </Default>
                    </Switch>
                </Default>
            </Switch>
            <HTML><![CDATA[<IMG SRC="]]></HTML>
            <FieldFilterImageURL/>
            <HTML><![CDATA[" BORDER=0 ALT="">]]></HTML>
        </RenderPattern>
        <RenderPattern Name="DisplayPattern">
            <FieldSwitch>
                <Expr>
                    <Property Select="FieldRef"/>
                </Expr>
                <Case Value="">
                    <FieldSwitch>
                        <Expr>
                            <Property Select="CountRelated"/>
                        </Expr>
                        <Case Value="TRUE">
                            <LookupColumn HTMLEncode="TRUE"/>
                        </Case>
                        <Default>
                            <Switch>
                                <Expr>
                                    <Column/>
                                </Expr>
                                <Case Value="">
                                </Case>
                                <Default>
                                    <FieldSwitch>
                                        <Expr>
                                            <Property Select="LookupType"/>
                                        </Expr>
                                        <Case Value="Computed">
                                            <LookupColumn/>
                                        </Case>
                                        <Default>
                                            <HTML><![CDATA[<A HREF="]]></HTML>
                                            <URL Cmd="Lookup"/>
                                            <HTML><![CDATA[">]]></HTML>
                                            <LookupColumn HTMLEncode="TRUE"/>
                                            <HTML><![CDATA[</A>]]></HTML>
                                        </Default>
                                    </FieldSwitch>
                                </Default>
                            </Switch>
                        </Default>
                    </FieldSwitch>
                </Case>
                <Default>
                    <LookupColumn HTMLEncode="TRUE"/>
                </Default>
            </FieldSwitch>
        </RenderPattern>
        <RenderPattern Name="EditPattern">
            <HTML><![CDATA[<SCRIPT>fld = new Field(frm,]]></HTML>
            <ScriptQuote>
                <Property Select="Name"/>
            </ScriptQuote>
            <HTML>,</HTML>
            <ScriptQuote>
                <Property Select="DisplayName"/>
            </ScriptQuote>
            <HTML><![CDATA[);</SCRIPT>]]></HTML>
            <HTML><![CDATA[<SELECT TITLE="]]></HTML>
            <Property Select="DisplayName"/>
            <HTML><![CDATA[" TABINDEX=1 NAME="]]></HTML>
            <FieldPrefix/>
            <Property Select="Name"/>
            <HTML><![CDATA[">]]></HTML>
            <Switch>
                <Expr>
                    <Property Select="Required"/>
                </Expr>
                <Case Value="TRUE">
                </Case>
                <Default>
                    <HTML><![CDATA[<OPTION Value="">]]></HTML>
                    <HTML>$Resources:core,onetfldtypes03;</HTML>
                    <HTML><![CDATA[</OPTION>]]></HTML>
                </Default>
            </Switch>
            <SelectOptions  Len="100" MoreText="..."/>
            <HTML><![CDATA[</SELECT>]]></HTML>
        </RenderPattern>
        <RenderPattern Name="NewPattern" DisplayName="NewPattern">
            <HTML><![CDATA[<SCRIPT>fld = new Field(frm,]]></HTML>
            <ScriptQuote>
                <Property Select="Name"/>
            </ScriptQuote>
            <HTML>,</HTML>
            <ScriptQuote>
                <Property Select="DisplayName"/>
            </ScriptQuote>
            <HTML><![CDATA[);</SCRIPT>]]></HTML>
            <HTML><![CDATA[<SELECT TABINDEX=1 NAME="]]></HTML>
            <FieldPrefix/>
            <Property Select="Name"/>
            <HTML><![CDATA[">]]></HTML>
            <Switch>
                <Expr>
                    <Property Select="Required"/>
                </Expr>
                <Case Value="TRUE">
                </Case>
                <Default>
                    <HTML><![CDATA[<OPTION Value="">]]></HTML>
                    <HTML>$Resources:core,onetfldtypes03;</HTML>
                    <HTML><![CDATA[</OPTION>]]></HTML>
                </Default>
            </Switch>
            <SelectOptions Len="100" MoreText="..."/>
            <HTML><![CDATA[</SELECT>]]></HTML>
        </RenderPattern>
        <RenderPattern Name="PreviewDisplayPattern">
            <HTML><![CDATA[["]]></HTML>
            <Property Select="DisplayName" HTMLEncode="TRUE"/>
            <HTML>"$Resources:core,fldtypes011;</HTML>
        </RenderPattern>
        <RenderPattern Name="PreviewEditPattern">
            <Switch>
                <Expr>
                    <Property Select="Format"/>
                </Expr>
                <Case Value="RadioButtons">
                    <HTML><![CDATA[<table cellpadding="0" cellspacing="1">]]></HTML>
                    <SetVar Name="_ChoiceDefault">
                        <Property Select="Default"/>
                    </SetVar>
                    <ForEach Select="CHOICES/CHOICE">
                        <HTML><![CDATA[<tr><td vAlign="top"> <input type="radio"]]></HTML>
                        <IfEqual>
                            <Expr1>
                                <Property Select="."/>
                            </Expr1>
                            <Expr2>
                                <GetVar Name="_ChoiceDefault"/>
                            </Expr2>
                            <Then>
                                <HTML><![CDATA[ checked]]></HTML>
                            </Then>
                        </IfEqual>
                        <HTML><![CDATA[></td><td class="ms-RadioText" vAlign="top">]]></HTML>
                        <Property Select="." HTMLEncode="TRUE"/>
                        <HTML><![CDATA[</td></tr>]]></HTML>
                    </ForEach>
                    <Switch>
                        <Expr>
                            <Property Select="FillInChoice"/>
                        </Expr>
                        <Case Value="TRUE">
                            <HTML><![CDATA[<tr><td vAlign="top"> <input type="radio"></td><td class="ms-RadioText" vAlign="top">]]></HTML>
                            <HTML>$Resources:core,fldtypes018;</HTML>
                            <HTML><![CDATA[</td></tr><tr><td vAlign="top"></td><td class="ms-RadioText" vAlign="top"> <input class="ms-input" value=""></td></tr>]]></HTML>
                        </Case>
                    </Switch>
                    <HTML><![CDATA[</table>]]></HTML>
                </Case>
                <Default>
                    <Switch>
                        <Expr>
                            <Property Select="FillInChoice"/>
                        </Expr>
                        <Case Value="TRUE">
                            <HTML><![CDATA[<table><tr><td vAlign="top"> <input type="radio"></td><td class="ms-RadioText" vAlign="top">]]></HTML>
                            <HTML><![CDATA[<select><option selected>"]]></HTML>
                            <Property Select="DisplayName" HTMLEncode="TRUE"/>
                            <HTML>"$Resources:core,fldtypes012;</HTML>
                            <HTML><![CDATA[</option></select>]]></HTML>
                            <HTML><![CDATA[</td></tr>]]></HTML>
                            <HTML><![CDATA[<tr><td vAlign="top"> <input type="radio"></td><td class="ms-RadioText" vAlign="top">]]></HTML>
                            <HTML>$Resources:core,fldtypes018;</HTML>
                            <HTML><![CDATA[</td></tr><tr><td vAlign="top"></td><td class="ms-RadioText" vAlign="top"> <input class="ms-input" value=""></td></tr></table>]]></HTML>
                        </Case>
                        <Default>
                            <HTML><![CDATA[<select><option selected>"]]></HTML>
                            <Property Select="DisplayName" HTMLEncode="TRUE"/>
                            <HTML>"$Resources:core,fldtypes012;</HTML>
                            <HTML><![CDATA[</option></select>]]></HTML>
                        </Default>
                    </Switch>
                </Default>
            </Switch>
        </RenderPattern>
        <RenderPattern Name="PreviewNewPattern">
            <Switch>
                <Expr>
                    <Property Select="Format"/>
                </Expr>
                <Case Value="RadioButtons">
                    <HTML><![CDATA[<table cellpadding="0" cellspacing="1">]]></HTML>
                    <SetVar Name="_ChoiceDefault">
                        <Property Select="Default"/>
                    </SetVar>
                    <ForEach Select="CHOICES/CHOICE">
                        <HTML><![CDATA[<tr><td vAlign="top"> <input type="radio"]]></HTML>
                        <IfEqual>
                            <Expr1>
                                <Property Select="."/>
                            </Expr1>
                            <Expr2>
                                <GetVar Name="_ChoiceDefault"/>
                            </Expr2>
                            <Then>
                                <HTML><![CDATA[ checked]]></HTML>
                            </Then>
                        </IfEqual>
                        <HTML><![CDATA[></td><td class="ms-RadioText" vAlign="top">]]></HTML>
                        <Property Select="." HTMLEncode="TRUE"/>
                        <HTML><![CDATA[</td></tr>]]></HTML>
                    </ForEach>
                    <Switch>
                        <Expr>
                            <Property Select="FillInChoice"/>
                        </Expr>
                        <Case Value="TRUE">
                            <HTML><![CDATA[<tr><td vAlign="top"> <input type="radio"></td><td class="ms-RadioText" vAlign="top">]]></HTML>
                            <HTML>$Resources:core,fldtypes018;</HTML>
                            <HTML><![CDATA[</td></tr><tr><td vAlign="top"></td><td class="ms-RadioText" vAlign="top"> <input class="ms-input" value=""></td></tr>]]></HTML>
                        </Case>
                    </Switch>
                    <HTML><![CDATA[</table>]]></HTML>
                </Case>
                <Default>
                    <Switch>
                        <Expr>
                            <Property Select="FillInChoice"/>
                        </Expr>
                        <Case Value="TRUE">
                            <HTML><![CDATA[<table><tr><td vAlign="top"> <input type="radio"></td><td class="ms-RadioText" vAlign="top">]]></HTML>
                            <HTML><![CDATA[<select><option selected>"]]></HTML>
                            <Property Select="DisplayName" HTMLEncode="TRUE"/>
                            <HTML>"$Resources:core,fldtypes012;</HTML>
                            <HTML><![CDATA[</option></select>]]></HTML>
                            <HTML><![CDATA[</td></tr>]]></HTML>
                            <HTML><![CDATA[<tr><td vAlign="top"> <input type="radio"></td><td class="ms-RadioText" vAlign="top">]]></HTML>
                            <HTML>$Resources:core,fldtypes018;</HTML>
                            <HTML><![CDATA[</td></tr><tr><td vAlign="top"></td><td class="ms-RadioText" vAlign="top"> <input class="ms-input" value=""></td></tr></table>]]></HTML>
                        </Case>
                        <Default>
                            <HTML><![CDATA[<select><option selected>"]]></HTML>
                            <Property Select="DisplayName" HTMLEncode="TRUE"/>
                            <HTML>"$Resources:core,fldtypes012;</HTML>
                            <HTML><![CDATA[</option></select>]]></HTML>
                        </Default>
                    </Switch>
                </Default>
            </Switch>
        </RenderPattern>
        <PropertySchema>
            <Fields>
                <Field Name="AdditionalLookupFields" Hidden="TRUE" DisplayName="AdditionalLookupFieldsL" Type="Text">
                    <Default />
                </Field>
                <Field Name="CamlQueryFields" Hidden="TRUE" DisplayName="CamlQueryFields" Type="Text">
                    <Default />
                </Field>
                <Field Name="DialogPageUrl" Hidden="TRUE" DisplayName="Dialog page URL" Type="Text">
                    <Default />
                </Field>
                <Field Name="DialogWidth" Hidden="TRUE" DisplayName="Dialog page width" Type="Text">
                    <Default />
                </Field>
                <Field Name="DialogHeight" Hidden="TRUE" DisplayName="Dialog page height" Type="Text">
                    <Default />
                </Field>
                <Field Name="QueryStringParam" Hidden="TRUE" DisplayName="Query string parameter" Type="Text">
                    <Default />
                </Field>
                <Field Name="CamlQuery" Hidden="TRUE" DisplayName="CAML Query used in ajax request" Type="Text">
                    <Default />
                </Field>
                <Field Name="Prefix" Type="Integer" Hidden="TRUE"></Field>
                <Field Name="ItemLimit" Type="Integer" Hidden="TRUE"></Field>
                <Field Name="InitValueQueryStringParam" Hidden="TRUE" DisplayName="Init value query string parameter" Type="Text">
                </Field>
            </Fields>
        </PropertySchema>
    </FieldType>
</FieldTypes>




